package com.jingyanzi.sys.text;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jingyanzi.sys.domain.FeedbackDO;
import com.jingyanzi.sys.domain.result.PageAll;
import com.jingyanzi.sys.domain.service.IFeedbackService;

@RestController
@RequestMapping("/feedback")
public class FeedbackDemo {
	
	@Autowired
	private IFeedbackService iFeedbackService;
	@RequestMapping("/add")
	public Object add() {
		FeedbackDO feedbackDO=new FeedbackDO();
		feedbackDO.setCode("6666");
		feedbackDO.setUsercode("cl");
		feedbackDO.setRealname("mm");
		feedbackDO.setContent("ddd");
		feedbackDO.setLevel(2);
		feedbackDO.setIsView(2);
		feedbackDO.setIsDelete(1);
		return iFeedbackService.add(feedbackDO);
	}
	@RequestMapping("/showById")
	public Object showById() {
		
		return iFeedbackService.get(1);
	}
	
	@RequestMapping("/delete")
	public Object delete() {
		
		return iFeedbackService.remove(1);
	}
	@RequestMapping("/update")
	public Object update() {
		
		FeedbackDO feedBackDO=new FeedbackDO();
		feedBackDO.setId(1);
		feedBackDO.setCode("ddddddd");
		return iFeedbackService.modifi(feedBackDO);
	}
	
	@RequestMapping("/showAll")
	public Object showAll() {
		
		PageAll page=new PageAll();
		page.setPagesize(2);
		page.setPageindex(1);
		return iFeedbackService.query(null, page);
	}
}
